Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create random_menu.rb #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create random_menu.rb #25

wants to merge 1 commit into from

Conversation

idevera
Copy link

@idevera idevera commented Aug 10, 2017

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why? I stored menu components into an array ie. adjectives, styles, and foods because I wanted to be able to pull randomly from each array to create a unique menu. Each array has a unique collection of related items
Could you have stored components using a different data structure? For example, if you used an Array could you have used a Hash? I do not think a hash would have been as efficient in this case as we were looking at single objects rather than a key: value pair.
Did you find yourself repeating the same code? Why did you have to do it that way? Yes. I was repeating my code when using three different arrays to store each type of value and when I was deleting objects from each array (optionals)
What type of loop did you use? Why did you choose that type? I used a times loop since the question specified 10 menu options. For optional enhancement #3 for user input, I indicated 5 menu items but only did a loop 3 times. (The loop should actually read 5.times, not 3 (: )

#
# # Delete from array so that it will not be used again
# adjs.delete(adjs_value)
# style.delete(style_value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clever way to make sure all elements are unique. I also like that you've broken out the three steps (choose a word, print the word, delete it from the array) rather than trying to do it all in one line - good style instincts.

@droberts-sea
Copy link
Collaborator

Random Menu

What We're Looking For

Feature Feedback
Random Menu of 10 items displayed in the terminal. yes
Generator pulls one random item from each array to create menu items. yes
Baseline
Readable code with consistent indentation. yes

Your code as submitted is all commented out - I had to go in and edit it to make it run. Submitted code should always be ready to go with minimal work from the user.

Other than that great work, especially on the optionals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants